<?
REQUIRE("../../protect/connect.php");

$query="SELECT batiment_id, batiment_unite_aide,batiment_niv FROM SDBatiment WHERE batiment_style='tour'";
//0=ID, 1=Population, 2=taux nutrition, 3= regime alimentaire, 4=stock.
$resultat=mysql_query($query);


WHILE ($element=mysql_fetch_array($resultat)){

$tmp=EXPLODE("-",$element[1]);
//$tribu=$tmp[1];
$tmp[1]+=$element[2];
$tmp2=IMPLODE("-",$tmp);

$query="UPDATE SDBatiment SET batiment_unite_aide=$tmp2 WHERE batiment_id=$element[0]";
$resultat2=mysql_query($query);
echo $query."<BR>";





}


mysql_close;
?>
